<template>
	<!-- 产品认证 -->
	<view class="productCertification">
		<view v-for="(item,index) in certificateList" :key="index">
			<view v-if="item.certificateOrgan">
				<view class="content" >
					<view class="content_item">认证机构：<text>{{item.certificateOrgan}}</text></view>
					<view class="content_item">认证时间：<text>{{item.certificateProvideTime}}</text></view>
					<!-- <view class="content_item">认证文件：<text></text></view> -->
				</view>
				<view class="rzwj">认证文件:</view>
				<image  @click="lookover(item.certificatePic)"  :src="item.certificatePic" mode="widthFix"></image>
				<view class="lookover">点击查看大图</view>
			</view>
		</view>
	</view>
</template>

<script>
	// 		 				认证
	import {imgUrl,getCertificate} from "../../api/api_test.js"
	export default {
		data() {
			return {
				imgUrl:imgUrl,
				productId:'',
				certificateList:[]
			};
		},
		onLoad(options){
			this.productId = options.productId
			// 获取产品证书
			this.getProductCertificate()
		},
		methods:{
			// 获取产品证书
			getProductCertificate(){
				getCertificate({certificateProduct:uni.getStorageSync('id')},res=>{
					console.log("res 获取产品证书",res)
					if(res.code == 200&&res.data){
						this.certificateList = res.data
						this.certificateList.forEach(val=>{
							if(val.certificatePic){
								val.certificatePic = this.imgUrl + val.certificatePic
							}
						})
					}
				})
			},
			lookover(url){
				// console.log("url",url)
				uni.previewImage({
					urls:[url]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.productCertification{
	flex: 1;
	background: url(../../static/maizi.png) no-repeat;
	background-size: 100% 100% ;
	>view{
		
		>view{
			width: 100%;
			padding: 20rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			align-items: center;
			.content{
				width: 100%;
				padding: 0 20rpx;
				box-sizing: border-box;
				font-size: 28rpx;
				// font-weight: bold;
				.content_item{
					line-height: 80rpx;
					display: flex;
					justify-content: space-between;
					border-bottom: 1px solid #B7B7B7;
					text{
						color: #B7B7B7;
					}
				}
			}
			.rzwj{
				padding: 0 20rpx;
				box-sizing: border-box;
				width: 100%;
				color: #9AC454;
				font-size: 40rpx;
				margin-top: 60rpx ;
			}
			.lookover{
				font-size: 18rpx;
				color: #818181;
				margin-bottom: 20rpx;
			}
			image{
				width: 450rpx;
				height: 600rpx;
				margin: 50rpx 0;
			}
		}
	}
}
</style>
